<!DOCTYPE html>  
<html>  
    <head>  
        <title>Tweet Streamer</title>  
        <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>  
    </head>  
    <body>  
        <ul id="tweets"></ul>  
        <script type="text/javascript">  
        var tweet_list = $("#tweets");  
        function load_tweets() {  
            $.getJSON("/stream", function(tweets) {  
                $.each(tweets, function() {  
                    $("<li>").html(this.text).prependTo(tweet_list);  
                });  
                load_tweets();  
            });  
        }  
        setTimeout(load_tweets, 1000);  
        </script>  
    </body>  
</html>